<?php
  session_start();
  error_reporting(0);
  $error = $_GET['error'];
  $status = $_GET['status'];
  $username = $_SESSION['username'];
  
  //User tried to access without loggin in.
  if($username == "")
  {
    header("Location:index.php?error=Please login first.");
  }
  include 'test.php';?>
<html>
<head>
<title>Welcome to your portfolio</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.css">
<style>
	a {
	text-decoration: none;
	}
</style>
</head>
<body style="background-color: #CCCCCC">
        
<div class="container">
	<div class="hero-unit">
        <h1>Welcome back, <?php echo strtoupper($username);?></h1>
	</div>

      <div class="row-fluid">
		<div class="span8 offset2">
			<ul class="nav nav-pills span10 offset1">
				<li><a class="btn" href="add.php">Add Position</a></li>
				<li><a class="btn" href="modify.php">Modify Position</a></li>
				<li><a class="btn" href="delete.php">Delete Position</a></li>
				<li><a class="btn" href="logout.php">Logout of Portfolio</a></li>
			</ul>
		</div>
	  </div>
	  <?php if(isset($error)) {
						?><p style="color:red;font-weight:700;"><?php
						echo $error;?></p><?php
					} elseif (isset($status)) {
						?><p><?php
						echo $status;?></p><?php
					}?>
	  <div class="row">
		<div class="span12">
			<h2>Current Positions</h2>
			<!--<table>
			<tr>
				<td><h3>Stock Name<h3></td>
				<td><h3>Shares</h3></td>
				<td><h3>Price</h3></td>
				<td><h3>Position Value</h3></td>
			</tr>-->
			<?php include("viewFrame.php"); ?>
			<table>
		</div>
	  </div>
</div>
</body>
</html>
